import time
import pytest
from appium import webdriver

desirede_caps = {
    "platformName": "Android",
    "platformVersion": "7.1.2",
    "deviceName": "emulator-5554",
    "appPackage": "com.tencent.wework",
    "appActivity": ".launch.WwMainActivity",
    # 'fullReset': False,
    'noReset': 'true'
}
#
# driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desirede_caps)

@pytest.fixture(scope="session", autouse=True)
def in_and_out():
    driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desirede_caps)
    time.sleep(5)
    yield driver
    driver.quit()